package Comparable;
use Moose::Role;

with 'Eq';

requires 'compare';

sub equal_to {
	my ( $self, $other ) = @_;
	$self->compare($other) == 0;
}

sub greather_than {
	my ( $self, $other ) = @_;
	$self->compare($other) == 1;
}

sub less_than {
	my ($self, $other) = @_;
	$self->compare($other) == -1;
}

sub greater_than_or_equal_to {
	my ( $self, $other ) = @_;
	$self->greater_than($other) || $self->equal_to($other);
}

sub less_than_or_equal_to {
	my ( $self,$other ) = @_;
	$self->less_than($other) || $self->equal_to($other);
}

1;